﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_TimPhieuThuTienThua : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvDoiTuong")]
        private ADVObjects _AdvDoiTuong;
        [AccessedThroughProperty("CmdClose")]
        private Button _CmdClose;
        [AccessedThroughProperty("CmdLoad")]
        private Button _CmdLoad;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label13")]
        private Label _Label13;
        [AccessedThroughProperty("Label16")]
        private Label _Label16;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("Panel3")]
        private Panel _Panel3;
        [AccessedThroughProperty("TxtDenNgay")]
        private DateTimePicker _TxtDenNgay;
        [AccessedThroughProperty("TxtTuNgay")]
        private DateTimePicker _TxtTuNgay;
        [AccessedThroughProperty("VSlist")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlist;
        private IContainer components;
        public string LoaiKhachHang;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private DataView objData;
        public object objFrmCall;
        private clsNhapKho objNK;
        private DataTable pData;
        public string pValue;

        public Frm_TimPhieuThuTienThua()
        {
            base.FormClosing += new FormClosingEventHandler(this.Frm_TimPhieuThuTienThua_FormClosing);
            base.KeyDown += new KeyEventHandler(this.Frm_TimPhieuThuTienThua_KeyDown);
            base.Load += new EventHandler(this.Frm_TimPhieuThuTienThua_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.LoaiKhachHang = "";
            this.mAllowView = false;
            this.mAllowDel = false;
            this.mAllowEdit = false;
            this.mAllowAdd = false;
            this.objNK = new clsNhapKho();
            this.InitializeComponent();
        }

        private void AdvDoiTuong_ValueChanged(object sender, EventArgs e)
        {
            this.LoadData();
        }

        private void CmdClose_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdLoad_Click(object sender, EventArgs e)
        {
            this.LoadData();
        }

        private void CmdRefresh_Click(object sender, EventArgs e)
        {
            this.LoadData();
        }

        public void ConfigGrid()
        {
            this.VSlist.AllowMerging = AllowMergingEnum.FixedOnly;
            this.VSlist.Rows[0].AllowMerging = true;
            this.VSlist.Cols[1].AllowMerging = true;
            this.VSlist.Cols[2].AllowMerging = true;
            this.VSlist.Cols[3].AllowMerging = true;
            this.VSlist.Cols[4].AllowMerging = true;
            this.VSlist.Cols[5].AllowMerging = true;
            this.VSlist.Cols[6].AllowMerging = true;
            this.VSlist.Cols[7].AllowMerging = true;
            this.VSlist.Cols[0x10].AllowMerging = true;
            this.VSlist.Cols[1].TextAlignFixed = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[2].TextAlignFixed = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[3].TextAlignFixed = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[4].TextAlignFixed = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[5].TextAlignFixed = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[6].TextAlignFixed = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[7].TextAlignFixed = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[8].TextAlignFixed = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[9].TextAlignFixed = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[10].TextAlignFixed = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[11].TextAlignFixed = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[12].TextAlignFixed = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[12].TextAlignFixed = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[13].TextAlignFixed = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[14].TextAlignFixed = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[15].TextAlignFixed = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[0x10].TextAlignFixed = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[2].TextAlign = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[4].TextAlign = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[5].TextAlign = TextAlignEnum.CenterCenter;
            this.VSlist[0, 1] = modGeneral.Tranlated("Số chứng từ", "");
            this.VSlist[1, 1] = modGeneral.Tranlated("Số chứng từ", "");
            this.VSlist[0, 2] = modGeneral.Tranlated("Ng\x00e0y chứng từ", "");
            this.VSlist[1, 2] = modGeneral.Tranlated("Ng\x00e0y chứng từ", "");
            this.VSlist[0, 3] = modGeneral.Tranlated("H\x00f3a đơn", "");
            this.VSlist[1, 3] = modGeneral.Tranlated("H\x00f3a đơn", "");
            this.VSlist[0, 4] = modGeneral.Tranlated("Ng\x00e0y h\x00f3a đơn", "");
            this.VSlist[1, 4] = modGeneral.Tranlated("Ng\x00e0y h\x00f3a đơn", "");
            this.VSlist[0, 5] = modGeneral.Tranlated("Loại tiền", "");
            this.VSlist[1, 5] = modGeneral.Tranlated("Loại tiền", "");
            this.VSlist[0, 6] = modGeneral.Tranlated("Tỷ gi\x00e1", "");
            this.VSlist[1, 6] = modGeneral.Tranlated("Tỷ gi\x00e1", "");
            this.VSlist[0, 7] = modGeneral.Tranlated("Nh\x00e0 cung cấp", "");
            this.VSlist[1, 7] = modGeneral.Tranlated("Nh\x00e0 cung cấp", "");
            this.VSlist[0, 8] = modGeneral.Tranlated("Số tiền gốc", "");
            this.VSlist[0, 9] = modGeneral.Tranlated("Số tiền gốc", "");
            this.VSlist[1, 8] = modGeneral.Tranlated("Giao dịch", "");
            this.VSlist[1, 9] = modGeneral.Tranlated("Ghi sổ", "");
            this.VSlist[0, 10] = modGeneral.Tranlated("Số tiền đ\x00e3 thanh to\x00e1n", "");
            this.VSlist[0, 11] = modGeneral.Tranlated("Số tiền đ\x00e3 thanh to\x00e1n", "");
            this.VSlist[1, 10] = modGeneral.Tranlated("Giao dịch", "");
            this.VSlist[1, 11] = modGeneral.Tranlated("Ghi sổ", "");
            this.VSlist[0, 12] = modGeneral.Tranlated("Số tiền cấn trừ", "");
            this.VSlist[0, 13] = modGeneral.Tranlated("Số tiền cấn trừ", "");
            this.VSlist[1, 12] = modGeneral.Tranlated("Giao dịch", "");
            this.VSlist[1, 13] = modGeneral.Tranlated("Ghi sổ", "");
            this.VSlist[0, 14] = modGeneral.Tranlated("Số dư", "");
            this.VSlist[0, 15] = modGeneral.Tranlated("Số dư", "");
            this.VSlist[1, 14] = modGeneral.Tranlated("Giao dịch", "");
            this.VSlist[1, 15] = modGeneral.Tranlated("Ghi sổ", "");
            this.VSlist[0, 0x10] = modGeneral.Tranlated("Diễn giải", "");
            this.VSlist[1, 0x10] = modGeneral.Tranlated("Diễn giải", "");
            this.VSlist.Cols[0].Visible = false;
            this.VSlist.Cols[0x11].Visible = false;
            this.VSlist.Cols[1].Width = 100;
            this.VSlist.Cols[2].Width = 100;
            this.VSlist.Cols[3].Width = 60;
            this.VSlist.Cols[4].Width = 100;
            this.VSlist.Cols[5].Width = 100;
            this.VSlist.Cols[6].Width = 100;
            this.VSlist.Cols[8].DataType = System.Type.GetType("Decimal");
            this.VSlist.Cols[8].Format = "##,##0.00";
            this.VSlist.Cols[9].DataType = System.Type.GetType("Decimal");
            this.VSlist.Cols[9].Format = "##,##0.00";
            this.VSlist.Cols[10].DataType = System.Type.GetType("Decimal");
            this.VSlist.Cols[10].Format = "##,##0.00";
            this.VSlist.Cols[11].DataType = System.Type.GetType("Decimal");
            this.VSlist.Cols[11].Format = "##,##0.00";
            this.VSlist.Cols[12].DataType = System.Type.GetType("Decimal");
            this.VSlist.Cols[12].Format = "##,##0.00";
            this.VSlist.Cols[13].DataType = System.Type.GetType("Decimal");
            this.VSlist.Cols[13].Format = "##,##0.00";
            this.VSlist.Cols[14].DataType = System.Type.GetType("Decimal");
            this.VSlist.Cols[14].Format = "##,##0.00";
            this.VSlist.Cols[15].DataType = System.Type.GetType("Decimal");
            this.VSlist.Cols[15].Format = "##,##0.00";
            if (this.VSlist.Rows.Count > 2)
            {
                this.VSlist.Select(2, 1);
            }
            this.VSlist.Focus();
            this.VSlist.Styles.Alternate.BackColor = ProfessionalColors.ToolStripGradientMiddle;
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing && (this.components != null))
                {
                    this.components.Dispose();
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }

        private void Frm_TimPhieuThuTienThua_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.objFrmCall = null;
        }

        private void Frm_TimPhieuThuTienThua_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
                case Keys.Escape:
                    this.Dispose();
                    break;

                case Keys.F5:
                    this.CmdRefresh_Click(RuntimeHelpers.GetObjectValue(sender), e);
                    break;
            }
        }

        private void Frm_TimPhieuThuTienThua_Load(object sender, EventArgs e)
        {
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.Cursor = Cursors.WaitCursor;
                this.TxtTuNgay.Text = "01/" + LVYModule.sRight("00" + Conversions.ToString(DateAndTime.Month(DateAndTime.Today)), 2) + "/" + Conversions.ToString(DateAndTime.Year(DateAndTime.Today));
                this.ConfigGrid();
                this.LoadData();
                this.Cursor = Cursors.Default;
            }
        }

        public DataTable GetDataFromMuaHang(string sotaikhoan)
        {
            DataTable table;
            string commandText = "";
            string str2 = "";
            if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectNotEqual(LVYModule.ReturnIfNull(this.AdvDoiTuong.Value, "", modGeneral.TypeOfValue.Nothing), "", false))
            {
                str2 = str2 + " AND RTrim(CTQCT.KHOADOITUONG) = '" + this.AdvDoiTuong.Value + "'";
            }
            commandText = "select CTQCT.KHOA AS KHOACHUNGTU, CTQ.SOCHUNGTU, dbo.Char2Date(CTQ.NGAYCHUNGTU) AS NGAYCHUNGTU, CTQCT.SOHOADON, CTQCT.NGAYHOADON, CTQCT.LOAITIEN, CTQCT.TYGIA, CTQCT.SOTIENNT AS SOTIENGOCNT, CTQCT.SOTIEN AS SOTIENGOC, 0 AS SoTienCanTruNT, 0 AS SoTienCanTru, 0 AS SOTIENDUNT, 0 AS SOTIENDU, CTQCT.DIENGIAI, DMDT.TENVIET AS TENDOITUONG, CTQCT.KHOACHUNGTU AS KHOACHUNGTU_VIP from GL_CHUNGTUQUY CTQ left join GL_CHUNGTUQUYCHITIET CTQCT on CTQ.KHOA = CTQCT.KHOACHUNGTU  left join DM_TAIKHOAN DMTK on CTQCT.KHOATAIKHOAN = DMTK.KHOA left join DM_DOITUONG DMDT on CTQCT.KHOADOITUONG = DMDT.KHOA where DMTK.SOTAIKHOAN = '" + sotaikhoan + "' AND CTQ.NGAYCHUNGTU >='" + LVYModule.Date2Char(this.TxtTuNgay.Text) + "' AND CTQ.NGAYCHUNGTU <= '" + LVYModule.Date2Char(this.TxtDenNgay.Text) + "' AND CTQCT.FLAGTAMUNG = -1 " + str2;
            try
            {
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0]).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message);
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_TimPhieuThuTienThua));
            this.Panel1 = new Panel();
            this.CmdClose = new Button();
            this.CmdLoad = new Button();
            this.Label16 = new Label();
            this.AdvDoiTuong = new ADVObjects();
            this.Label1 = new Label();
            this.TxtDenNgay = new DateTimePicker();
            this.Label13 = new Label();
            this.TxtTuNgay = new DateTimePicker();
            this.VSlist = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.Panel3 = new Panel();
            this.Panel1.SuspendLayout();
            this.VSlist.BeginInit();
            this.SuspendLayout();
            this.Panel1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel1.Controls.Add(this.CmdClose);
            this.Panel1.Controls.Add(this.CmdLoad);
            this.Panel1.Controls.Add(this.Label16);
            this.Panel1.Controls.Add(this.AdvDoiTuong);
            this.Panel1.Controls.Add(this.Label1);
            this.Panel1.Controls.Add(this.TxtDenNgay);
            this.Panel1.Controls.Add(this.Label13);
            this.Panel1.Controls.Add(this.TxtTuNgay);
            this.Panel1.Dock = DockStyle.Top;
            Point point = new Point(0, 0);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            Size size = new Size(0x37c, 0x39);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0x1c;
            this.CmdClose.Image = ACCOUNTING.My.Resources.Resources.Closed;
            this.CmdClose.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x31e, 0x13);
            this.CmdClose.Location = point;
            this.CmdClose.Name = "CmdClose";
            size = new Size(0x57, 0x17);
            this.CmdClose.Size = size;
            this.CmdClose.TabIndex = 0x7c;
            this.CmdClose.Text = "Tho\x00e1t";
            this.CmdClose.UseVisualStyleBackColor = true;
            this.CmdLoad.Image = ACCOUNTING.My.Resources.Resources.Selected;
            this.CmdLoad.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x2c4, 0x13);
            this.CmdLoad.Location = point;
            this.CmdLoad.Name = "CmdLoad";
            size = new Size(0x57, 0x17);
            this.CmdLoad.Size = size;
            this.CmdLoad.TabIndex = 0x7c;
            this.CmdLoad.Text = "Load";
            this.CmdLoad.UseVisualStyleBackColor = true;
            this.Label16.AutoEllipsis = true;
            this.Label16.AutoSize = true;
            this.Label16.BackColor = Color.Transparent;
            point = new Point(0xb8, 4);
            this.Label16.Location = point;
            this.Label16.Name = "Label16";
            this.Label16.RightToLeft = RightToLeft.No;
            size = new Size(0x41, 13);
            this.Label16.Size = size;
            this.Label16.TabIndex = 0x72;
            this.Label16.Text = "Kh\x00e1ch h\x00e0ng";
            this.Label16.TextAlign = ContentAlignment.TopRight;
            this.AdvDoiTuong.Conditions = "";
            this.AdvDoiTuong.LoaiDoiTuong = modGeneral.TypeObjects.KhachHang;
            point = new Point(0xbb, 20);
            this.AdvDoiTuong.Location = point;
            this.AdvDoiTuong.Name = "AdvDoiTuong";
            this.AdvDoiTuong.ReadOnly = false;
            size = new Size(0x12e, 20);
            this.AdvDoiTuong.Size = size;
            this.AdvDoiTuong.TabIndex = 0x71;
            this.AdvDoiTuong.UpperText = true;
            this.AdvDoiTuong.Value = "";
            this.AdvDoiTuong.WidthCode = 80;
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            point = new Point(0x5d, 4);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x35, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x3f;
            this.Label1.Text = "Đến ng\x00e0y";
            this.TxtDenNgay.Format = DateTimePickerFormat.Custom;
            point = new Point(0x60, 20);
            this.TxtDenNgay.Location = point;
            this.TxtDenNgay.Name = "TxtDenNgay";
            size = new Size(0x55, 20);
            this.TxtDenNgay.Size = size;
            this.TxtDenNgay.TabIndex = 0x3e;
            this.Label13.AutoSize = true;
            this.Label13.BackColor = Color.Transparent;
            point = new Point(4, 6);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x2e, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 0x3d;
            this.Label13.Text = "Từ ng\x00e0y";
            this.TxtTuNgay.Format = DateTimePickerFormat.Custom;
            point = new Point(7, 20);
            this.TxtTuNgay.Location = point;
            this.TxtTuNgay.Name = "TxtTuNgay";
            size = new Size(0x53, 20);
            this.TxtTuNgay.Size = size;
            this.TxtTuNgay.TabIndex = 60;
            this.VSlist.AllowEditing = false;
            this.VSlist.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.XpThemes;
            this.VSlist.ColumnInfo = "18,0,0,0,0,90,Columns:0{Caption:\"ID\";Visible:False;}\t";
            this.VSlist.Dock = DockStyle.Fill;
            this.VSlist.ExtendLastCol = true;
            this.VSlist.FocusRect = FocusRectEnum.None;
            this.VSlist.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new Point(0, 0x39);
            this.VSlist.Location = point;
            this.VSlist.Name = "VSlist";
            this.VSlist.Rows.Count = 2;
            this.VSlist.Rows.DefaultSize = 0x11;
            this.VSlist.Rows.Fixed = 2;
            this.VSlist.Rows.MaxSize = 0x12;
            this.VSlist.Rows.MinSize = 0x12;
            this.VSlist.SelectionMode = SelectionModeEnum.Row;
            size = new Size(0x37c, 0x18a);
            this.VSlist.Size = size;
            this.VSlist.StyleInfo = manager.GetString("VSlist.StyleInfo");
            this.VSlist.TabIndex = 0x1d;
            this.VSlist.VisualStyle = VisualStyle.Office2007Blue;
            this.Panel3.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel3.Dock = DockStyle.Bottom;
            point = new Point(0, 0x1b6);
            this.Panel3.Location = point;
            this.Panel3.Name = "Panel3";
            size = new Size(0x37c, 13);
            this.Panel3.Size = size;
            this.Panel3.TabIndex = 0x75;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x37c, 0x1c3);
            this.ClientSize = size;
            this.Controls.Add(this.Panel3);
            this.Controls.Add(this.VSlist);
            this.Controls.Add(this.Panel1);
            this.Name = "Frm_TimPhieuThuTienThua";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "DANH SACH PHIEU THU TIEN THUA";
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            this.VSlist.EndInit();
            this.ResumeLayout(false);
        }

        public void LoadData()
        {
            this.VSlist.Rows.Count = 2;
            if (this.LoaiKhachHang == "TN")
            {
                this.pData = this.GetDataFromMuaHang("1310");
            }
            else if (this.LoaiKhachHang == "NN")
            {
                this.pData = this.GetDataFromMuaHang("1311");
            }
            if (!((this.pData == null) | (this.pData.Rows.Count == 0)))
            {
                int num2 = this.pData.Rows.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                    vSlist.AddItem("");
                    vSlist[vSlist.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["KhoaChungTu"]);
                    vSlist[vSlist.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["SoChungTu"]);
                    vSlist[vSlist.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["NgayChungTu"]);
                    vSlist[vSlist.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["SoHoaDon"]);
                    vSlist[vSlist.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["NgayHoaDon"]);
                    vSlist[vSlist.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["LoaiTien"]);
                    vSlist[vSlist.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["TyGia"]);
                    vSlist[vSlist.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["TENDOITUONG"]);
                    vSlist[vSlist.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["SoTienGocNT"]);
                    vSlist[vSlist.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["SoTienGoc"]);
                    vSlist[vSlist.Rows.Count - 1, 10] = 0;
                    vSlist[vSlist.Rows.Count - 1, 11] = 0;
                    vSlist[vSlist.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["SoTienCanTruNT"]);
                    vSlist[vSlist.Rows.Count - 1, 13] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["SoTienCanTru"]);
                    vSlist[vSlist.Rows.Count - 1, 14] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["SoTienDuNT"]);
                    vSlist[vSlist.Rows.Count - 1, 15] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["SoTienDu"]);
                    vSlist[vSlist.Rows.Count - 1, 0x10] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["DienGiai"]);
                    vSlist[vSlist.Rows.Count - 1, 0x11] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["KhoaChungTu_Vip"]);
                    vSlist = null;
                }
            }
        }

        public void SetLanguage()
        {
            this.Text = modGeneral.Tranlated(this.Text, "");
            LVYModule.SetTitleGrid(this.VSlist);
        }

        private void TxtTuNgay_LostFocus(object sender, EventArgs e)
        {
            if (LVYModule.sRight(this.TxtTuNgay.Text, 7) != LVYModule.sRight(this.TxtDenNgay.Text, 7))
            {
                this.TxtDenNgay.Text = DateTime.DaysInMonth(Conversions.ToInteger(LVYModule.sRight(this.TxtTuNgay.Text, 4)), Conversions.ToInteger(LVYModule.sMid(this.TxtTuNgay.Text, 4, 2))).ToString() + "/" + LVYModule.sRight(this.TxtTuNgay.Text, 7);
            }
        }

        private void VSlist_DoubleClick(object sender, EventArgs e)
        {
            modGeneral.H_VALUE = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[this.VSlist.Row, 0]), "", modGeneral.TypeOfValue.Nothing));
            this.Dispose();
        }

        internal virtual ADVObjects AdvDoiTuong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvDoiTuong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                ADVObjects.ValueChangedEventHandler handler = new ADVObjects.ValueChangedEventHandler(this.AdvDoiTuong_ValueChanged);
                if (this._AdvDoiTuong != null)
                {
                    this._AdvDoiTuong.ValueChanged -= handler;
                }
                this._AdvDoiTuong = value;
                if (this._AdvDoiTuong != null)
                {
                    this._AdvDoiTuong.ValueChanged += handler;
                }
            }
        }

        internal virtual Button CmdClose
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdClose;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdClose_Click);
                if (this._CmdClose != null)
                {
                    this._CmdClose.Click -= handler;
                }
                this._CmdClose = value;
                if (this._CmdClose != null)
                {
                    this._CmdClose.Click += handler;
                }
            }
        }

        internal virtual Button CmdLoad
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdLoad;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdLoad_Click);
                if (this._CmdLoad != null)
                {
                    this._CmdLoad.Click -= handler;
                }
                this._CmdLoad = value;
                if (this._CmdLoad != null)
                {
                    this._CmdLoad.Click += handler;
                }
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual Label Label16
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label16;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label16 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual Panel Panel3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel3 = value;
            }
        }

        internal virtual DateTimePicker TxtDenNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDenNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDenNgay = value;
            }
        }

        internal virtual DateTimePicker TxtTuNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTuNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtTuNgay_LostFocus);
                if (this._TxtTuNgay != null)
                {
                    this._TxtTuNgay.LostFocus -= handler;
                }
                this._TxtTuNgay = value;
                if (this._TxtTuNgay != null)
                {
                    this._TxtTuNgay.LostFocus += handler;
                }
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSlist
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlist;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.VSlist_DoubleClick);
                if (this._VSlist != null)
                {
                    this._VSlist.DoubleClick -= handler;
                }
                this._VSlist = value;
                if (this._VSlist != null)
                {
                    this._VSlist.DoubleClick += handler;
                }
            }
        }
    }
}

